package com.brillilab.dao.mapper.kit;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.brillilab.domain.po.kit.Kit;
import com.brillilab.domain.po.system.Company;
import com.brillilab.domain.vo.kit.RecycleKitVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * KitMapper
 * @author lj
 *
 */
public interface KitMapper extends BaseMapper<Kit> {

	

	/**
	 * 试剂列表查询
	 * @param labId
	 * @param reagentTypeIds
	 * @param sort 排序方式：使用频率-0，更新时间-1；
	 * @return
	 */
	List<Kit> selectReagentList(@Param("labId")Long labId,	@Param("reagentTypeIds")List<Long> reagentTypeIds, @Param("sort")int sort);

	/**
	 * 样品列表查询
	 * @param labId
	 * @param reagentTypeId
	 * @param sort 排序方式：使用频率-0，更新时间-1；
	 * @return
	 */
	List<Kit> selectSampleList(@Param("labId")Long labId, @Param("reagentTypeId")Long reagentTypeId, @Param("reagentTypeIds")List<Long> reagentTypeIds, @Param("sort")int sort);

    /**
     * 查找删除的RecycleKitVo
     * @param isDelete
     * @return
     */
    List<RecycleKitVo> selectByIsDelete(@Param("labId")Long labId,@Param(("isDelete")) Integer isDelete);
   
    /**
     * 分组统计分类下试剂数量
     * @return
     */
    List<Map<String,Object>> groupByReagentType(@Param("labId")Long labId,@Param("classify")Integer classify);

    /**
	 * 根据panelID，状态正常并且kit_box_id不为null 查找kitName
	 */
    List<Kit> selectNameByPanelIdAndNotDelete(@Param("panelId")Long panelId);

    int updateAliasBatch(@Param("kits") List<Kit> updateKit);

	List<Company> getCompanyList(@Param("classify") Integer classify, @Param("labId") Long labId);

	/**
	 * 查询实验室有关联方法的试剂
	 */
	List<Kit> selectMethodReagentList(@Param("labId") Long labId,
									  @Param("classify") Integer classify,
									  @Param("reagentTypeId") Long reagentTypeId,
									  @Param("methodTypeId") Long methodTypeId,
									  @Param("keywords") String keywords);

	/**
	 * 查询实验室所有试剂的fromId
	 */
    List<Long> selectKitFromIdList(@Param("labId")Long labId);
}
